package com.bz.backend.item.controller;

import com.bz.backend.item.service.ItemCategoryService;
import com.bz.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/backend/itemCategory")
public class ItemCategoryController {

    @Autowired
    private ItemCategoryService itemCategoryService;

    /**
     * 根据分类id查询子分类
     * @param id
     * @return
     */
    @GetMapping("/selectItemCategoryByParentId")
    public Result selectItemCategoryByParentId(@RequestParam Long id){
        return Result.ok(itemCategoryService.selectItemCategoryByParentId(id));
    };
}
